package core.models;
import java.util.List;
import core.models.items.*;
import java.io.Serializable;
/**
 * A store in the Oregon Trail game
 *
 * Has an inventory with all of the available items
 *
 */
public class Store implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Inventory inventory;
	/**
	 * Constructor that initializes the store
	 * 
	 * @param bulletPrice
	 * @param foodPrice
	 * @param gunPrice
	 * @param medicinePrice
	 * @param wagonAxlePrice
	 * @param wagonTonguePrice
	 * @param wagonWheelPrice
	 * @param clothingPrice
	 * @param oxenPrice
	 */
	public Store(int bulletPrice,
			int foodPrice, 
			int gunPrice, 
			int medicinePrice, 
			int wagonAxlePrice,
			int wagonTonguePrice, 
			int wagonWheelPrice,
			int clothingPrice,
			int oxenPrice){
		
		inventory = new Inventory();
		inventory.add(new Bullet(bulletPrice,0));
		inventory.add(new Food(foodPrice,0));
		inventory.add(new Gun(gunPrice,0));
		inventory.add(new Medicine(medicinePrice,0));
		inventory.add(new WagonAxle(wagonAxlePrice,0));
		inventory.add(new WagonTongue(wagonTonguePrice,0));
		inventory.add(new WagonWheel(wagonWheelPrice,0));
		inventory.add(new Clothing(clothingPrice,0));
		inventory.add(new Oxen(oxenPrice,0));
	}
	/**
	 * Gives the inventory as a list of items.
	 * 
	 * @return the inventory list
	 */
	public List<Item> getInventory() {
		return inventory.getItems();
	}
	
	public String toString() {
		String retStr = "";
		for(Item item : getInventory()){
			retStr+=item.getName() + "\n";
		}
		return retStr;
	}
}
